package com.dong.order.api.mq;

import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;

import java.nio.charset.StandardCharsets;

/**
 * @author zhaodongchao
 * @date 2020/11/19 17:42
 */
public class PolicyConsumerMessageListener implements MessageListener {
    @Override
    public Action consume(Message message, ConsumeContext context) {
        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
        System.out.println("我成功的接受到了消息："+msg);
        return Action.ReconsumeLater;
    }
}
